package com.stars.controller;

import com.stars.common.FileGenerater;
import com.stars.common.base.ResultMsg;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 文件生成器
 *
 * @author xiaowei
 */

@Controller
@RequestMapping
public class FileGeneratorController {

    @ResponseBody
    @RequestMapping(value = "/fileGenerate", method = RequestMethod.POST)
    public ResultMsg fileGenerate(String[] codes, String className, String type, String path) {
        FileGenerater fileGenerater = new FileGenerater();
        fileGenerater.createFile(className,type,path,codes);
        return ResultMsg.success();
    }


}
